Optimal. Leaf size=175 \[ -\frac {a^2 d \cos (c+d x)}{6 x^2}-\frac {a b d \cos (c+d x)}{x}+b^2 d \cos (c) \text {Ci}(d x)-\frac {1}{6} a^2 d^3 \cos (c) \text {Ci}(d x)-a b d^2 \text {Ci}(d x) \sin (c)-\frac {a^2 \sin (c+d x)}{3 x^3}-\frac {a b \sin (c+d x)}{x^2}-\frac {b^2 \sin (c+d x)}{x}+\frac {a^2 d^2 \sin (c+d x)}{6 x}-a b d^2 \cos (c) \text {Si}(d x)-b^2 d \sin (c) \text {Si}(d x)+\frac {1}{6} a^2 d^3 \sin (c) \text {Si}(d x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.27, antiderivative size = 175, normalized size of antiderivative = 1.00, number of steps
used = 17, number of rules used = 5, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {6874, 3378,
3384, 3380, 3383} \begin {gather*} -\frac {1}{6} a^2 d^3 \cos (c) \text {CosIntegral}(d x)+\frac {1}{6} a^2 d^3 \sin (c) \text {Si}(d x)+\frac {a^2 d^2 \sin (c+d x)}{6 x}-\frac {a^2 \sin (c+d x)}{3 x^3}-\frac {a^2 d \cos (c+d x)}{6 x^2}-a b d^2 \sin (c) \text {CosIntegral}(d x)-a b d^2 \cos (c) \text {Si}(d x)-\frac {a b \sin (c+d x)}{x^2}-\frac {a b d \cos (c+d x)}{x}+b^2 d \cos (c) \text {CosIntegral}(d x)-b^2 d \sin (c) \text {Si}(d x)-\frac {b^2 \sin (c+d x)}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3378
Rule 3380
Rule 3383
Rule 3384
Rule 6874
Rubi steps
\begin {align*} \int \frac {(a+b x)^2 \sin (c+d x)}{x^4} \, dx &=\int \left (\frac {a^2 \sin (c+d x)}{x^4}+\frac {2 a b \sin (c+d x)}{x^3}+\frac {b^2 \sin (c+d x)}{x^2}\right ) \, dx\\ &=a^2 \int \frac {\sin (c+d x)}{x^4} \, dx+(2 a b) \int \frac {\sin (c+d x)}{x^3} \, dx+b^2 \int \frac {\sin (c+d x)}{x^2} \, dx\\ &=-\frac {a^2 \sin (c+d x)}{3 x^3}-\frac {a b \sin (c+d x)}{x^2}-\frac {b^2 \sin (c+d x)}{x}+\frac {1}{3} \left (a^2 d\right ) \int \frac {\cos (c+d x)}{x^3} \, dx+(a b d) \int \frac {\cos (c+d x)}{x^2} \, dx+\left (b^2 d\right ) \int \frac {\cos (c+d x)}{x} \, dx\\ &=-\frac {a^2 d \cos (c+d x)}{6 x^2}-\frac {a b d \cos (c+d x)}{x}-\frac {a^2 \sin (c+d x)}{3 x^3}-\frac {a b \sin (c+d x)}{x^2}-\frac {b^2 \sin (c+d x)}{x}-\frac {1}{6} \left (a^2 d^2\right ) \int \frac {\sin (c+d x)}{x^2} \, dx-\left (a b d^2\right ) \int \frac {\sin (c+d x)}{x} \, dx+\left (b^2 d \cos (c)\right ) \int \frac {\cos (d x)}{x} \, dx-\left (b^2 d \sin (c)\right ) \int \frac {\sin (d x)}{x} \, dx\\ &=-\frac {a^2 d \cos (c+d x)}{6 x^2}-\frac {a b d \cos (c+d x)}{x}+b^2 d \cos (c) \text {Ci}(d x)-\frac {a^2 \sin (c+d x)}{3 x^3}-\frac {a b \sin (c+d x)}{x^2}-\frac {b^2 \sin (c+d x)}{x}+\frac {a^2 d^2 \sin (c+d x)}{6 x}-b^2 d \sin (c) \text {Si}(d x)-\frac {1}{6} \left (a^2 d^3\right ) \int \frac {\cos (c+d x)}{x} \, dx-\left (a b d^2 \cos (c)\right ) \int \frac {\sin (d x)}{x} \, dx-\left (a b d^2 \sin (c)\right ) \int \frac {\cos (d x)}{x} \, dx\\ &=-\frac {a^2 d \cos (c+d x)}{6 x^2}-\frac {a b d \cos (c+d x)}{x}+b^2 d \cos (c) \text {Ci}(d x)-a b d^2 \text {Ci}(d x) \sin (c)-\frac {a^2 \sin (c+d x)}{3 x^3}-\frac {a b \sin (c+d x)}{x^2}-\frac {b^2 \sin (c+d x)}{x}+\frac {a^2 d^2 \sin (c+d x)}{6 x}-a b d^2 \cos (c) \text {Si}(d x)-b^2 d \sin (c) \text {Si}(d x)-\frac {1}{6} \left (a^2 d^3 \cos (c)\right ) \int \frac {\cos (d x)}{x} \, dx+\frac {1}{6} \left (a^2 d^3 \sin (c)\right ) \int \frac {\sin (d x)}{x} \, dx\\ &=-\frac {a^2 d \cos (c+d x)}{6 x^2}-\frac {a b d \cos (c+d x)}{x}+b^2 d \cos (c) \text {Ci}(d x)-\frac {1}{6} a^2 d^3 \cos (c) \text {Ci}(d x)-a b d^2 \text {Ci}(d x) \sin (c)-\frac {a^2 \sin (c+d x)}{3 x^3}-\frac {a b \sin (c+d x)}{x^2}-\frac {b^2 \sin (c+d x)}{x}+\frac {a^2 d^2 \sin (c+d x)}{6 x}-a b d^2 \cos (c) \text {Si}(d x)-b^2 d \sin (c) \text {Si}(d x)+\frac {1}{6} a^2 d^3 \sin (c) \text {Si}(d x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.32, size = 154, normalized size = 0.88 \begin {gather*} -\frac {a^2 d x \cos (c+d x)+6 a b d x^2 \cos (c+d x)+d x^3 \text {Ci}(d x) \left (\left (-6 b^2+a^2 d^2\right ) \cos (c)+6 a b d \sin (c)\right )+2 a^2 \sin (c+d x)+6 a b x \sin (c+d x)+6 b^2 x^2 \sin (c+d x)-a^2 d^2 x^2 \sin (c+d x)+d x^3 \left (6 a b d \cos (c)+6 b^2 \sin (c)-a^2 d^2 \sin (c)\right ) \text {Si}(d x)}{6 x^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 158, normalized size = 0.90 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 1.42, size = 187, normalized size = 1.07 \begin {gather*} -\frac {{\left ({\left (a^{2} {\left (\Gamma \left (-3, i \, d x\right ) + \Gamma \left (-3, -i \, d x\right )\right )} \cos \left (c\right ) + a^{2} {\left (-i \, \Gamma \left (-3, i \, d x\right ) + i \, \Gamma \left (-3, -i \, d x\right )\right )} \sin \left (c\right )\right )} d^{5} - 6 \, {\left (a b {\left (-i \, \Gamma \left (-3, i \, d x\right ) + i \, \Gamma \left (-3, -i \, d x\right )\right )} \cos \left (c\right ) - a b {\left (\Gamma \left (-3, i \, d x\right ) + \Gamma \left (-3, -i \, d x\right )\right )} \sin \left (c\right )\right )} d^{4} - 6 \, {\left (b^{2} {\left (\Gamma \left (-3, i \, d x\right ) + \Gamma \left (-3, -i \, d x\right )\right )} \cos \left (c\right ) + b^{2} {\left (-i \, \Gamma \left (-3, i \, d x\right ) + i \, \Gamma \left (-3, -i \, d x\right )\right )} \sin \left (c\right )\right )} d^{3}\right )} x^{3} + 4 \, b^{2} \sin \left (d x + c\right ) + 2 \, {\left (b^{2} d x + 2 \, a b d\right )} \cos \left (d x + c\right )}{2 \, d^{2} x^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 186, normalized size = 1.06 \begin {gather*} -\frac {2 \, {\left (6 \, a b d x^{2} + a^{2} d x\right )} \cos \left (d x + c\right ) + {\left (12 \, a b d^{2} x^{3} \operatorname {Si}\left (d x\right ) + {\left (a^{2} d^{3} - 6 \, b^{2} d\right )} x^{3} \operatorname {Ci}\left (d x\right ) + {\left (a^{2} d^{3} - 6 \, b^{2} d\right )} x^{3} \operatorname {Ci}\left (-d x\right )\right )} \cos \left (c\right ) + 2 \, {\left (6 \, a b x - {\left (a^{2} d^{2} - 6 \, b^{2}\right )} x^{2} + 2 \, a^{2}\right )} \sin \left (d x + c\right ) + 2 \, {\left (3 \, a b d^{2} x^{3} \operatorname {Ci}\left (d x\right ) + 3 \, a b d^{2} x^{3} \operatorname {Ci}\left (-d x\right ) - {\left (a^{2} d^{3} - 6 \, b^{2} d\right )} x^{3} \operatorname {Si}\left (d x\right )\right )} \sin \left (c\right )}{12 \, x^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b x\right )^{2} \sin {\left (c + d x \right )}}{x^{4}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 6.54, size = 1400, normalized size = 8.00 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\sin \left (c+d\,x\right )\,{\left (a+b\,x\right )}^2}{x^4} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________